package cn.shit;
class Pair<T> {
    private T min;
    private T max;

    public Pair(T min, T max) {
        this.min = min;
        this.max = max;
    }

    public T getMin() {
        return min;
    }

    public void setMin(T min) {
        this.min = min;
    }

    public T getMax() {
        return max;
    }

    public void setMax(T max) {
        this.max = max;
    }

    @Override
    public String toString() {
        return "min: " + min + "\nmax: " + max;
    }
}
public class PairTest1 {
    public static <T> T show(T t) {
        return t;
    }
    public static Pair<String> getMinAndMax(String[] arr) {
        if (arr == null || arr.length == 0) {
            return null;
        }
        String min = arr[0];
        String max = arr[1];
        for (String s : arr) {
            if (s.compareTo(min) < 0) {
                min = s;
            }
            if (s.compareTo(max) > 0) {
                max = s;
            }
        }
        return new Pair<>(min, max);
    }
    public static void main(String[] args) {
        String[] mSarr = new String[]{"aaa", "ccc", "z", "zz"};
        System.out.println(getMinAndMax(mSarr));
    }
}

